package beer.xz.beer.device.ui.cover

import android.graphics.RenderEffect
import android.graphics.Shader
import androidx.compose.foundation.Image
import androidx.compose.foundation.background
import androidx.compose.foundation.clickable
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.size
import androidx.compose.material3.MaterialTheme
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.asComposeRenderEffect
import androidx.compose.ui.graphics.graphicsLayer
import androidx.compose.ui.layout.ContentScale
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.unit.dp
import beer.xz.beer.device.R

@Composable
fun CoverScreen(onTouch: () -> Unit) {

    Box(
        modifier = Modifier
            .size(1024.dp, 600.dp)
            .background(color = MaterialTheme.colorScheme.background)
    ) {
        Image(
            painter = painterResource(id = R.drawable.bg1),
            contentDescription = null,
            modifier = Modifier
                .fillMaxSize()
                .clickable {
                    onTouch()
                }
                .graphicsLayer {
                    renderEffect = RenderEffect.createBlurEffect(
                        10f, 10f, Shader.TileMode.CLAMP
                    ).asComposeRenderEffect()
                },
            contentScale = ContentScale.Crop
        )
        // 其他 UI 元素可以放在这里
    }
}